package huang.jan09.co2;

public  class RuningMatch {
		private String name ;
		private String winner;
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}

		
		//谁调用winner方法，谁获得胜利
		public void winner(){
			winner=this.name;
			if(winner=="乌龟"){
				System.out.println("乌龟赢了比赛");
			}
			if(winner=="猴子"){
				System.out.println("猴子赢了比赛");
			}
			if(winner=="兔子"){
				System.out.println("兔子赢了比赛");
			}
		}
	
		 void congratulate(){
				System.out.println("大家一起去喝水庆祝");
			
		}
		
}
